package day06;

public class Dog extends Animal{
    private double loyalty;

    public Dog(){
        System.out.println("Dog...");
    }

    public Dog(String name,String type,double loyalty){
        super(name,type);
        this.loyalty = loyalty;
        System.out.println("Dog全参构造被调用了...");
    }

    public double getLoyalty(){
        return loyalty;
    }

    public void setLoyalty(double loyalty){
        this.loyalty = loyalty;
    }

    @Override
    public String toString(){
        String str = "loyalty:"+loyalty;
        return super.toString()+str;
    }

    public void watchForDoor(){
        System.out.println("狗可以看门...");
    }

    @Override
    public void spark(){
        System.out.println("汪汪~~~");
    }
}
